import { innerUrls } from '@/shared/constants/urls';
import BasketImage from '@/shared/icons/emoji/basket-image.png';
import ArticleImage from '@/shared/icons/emoji/newspaper-image.png';
import { Placeholder } from '@/widgets/Placeholder';
import { useRouter } from 'next/router';

import cs from './Favourites.module.scss';

const params = {
  course: {
    icon: BasketImage,
    href: innerUrls.catalog,
    text: 'Вы пока не добавили материалы в избранное',
  },
  article: {
    icon: ArticleImage,
    href: innerUrls.articles,
    text: 'Вы пока не добавили статьи в избранное',
  },
};
export const NotFound = ({ variant }: { variant: 'course' | 'article' }) => {
  const router = useRouter();
  const handleRedirect = async () => {
    await router.push(params[variant].href);
  };
  return (
    <Placeholder
      buttonText="Перейти к выбору"
      className={cs.placeholder}
      icon={params[variant].icon}
      onClick={handleRedirect}
      text={params[variant].text}
    />
  );
};
